package com.atguigu.yygh.user.controller;

import com.atguigu.yygh.common.result.Result;
import com.atguigu.yygh.user.service.UserService;
import com.atguigu.yygh.vo.user.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/api/user")
@Api(tags="用户管理")
public class UserInfoApiController {

     @Autowired
     private UserService userService;

    // 用户手机号登入接口
    @PostMapping("login")
    @ApiOperation(value = "用户手机号登入")
    public Result  login(@RequestBody LoginVo loginVo){


          Map<String,Object> map   =  userService.loginUser(loginVo);

        return  Result.ok(map);

    }

}
